package Counter;

public class Printmovie {
    ///主要的任务就是将实体类中的数据进行相应的处理，将用户所输入的id打印出来相应的电影
    private Movie[] movies;

    public Printmovie(Movie[] movies) {
        this.movies = movies;
    }

    public void Printpass(int id) {
        System.out.println("-------------电影的详细信息--------");
        for (int i = 0; i < movies.length; i++) {
            if (movies[i].getid() == id) {///之前的错误之处有两个di
                System.out.println("电影的Id:" + movies[i].getid());
                System.out.println("电影的名字:" + movies[i].getName());
                System.out.println("电影的价格:" + movies[i].getPrice());
                System.out.println("电影的评分:" + movies[i].getScorce());
                System.out.println("电影的导演:" + movies[i].getDirector());
                System.out.println("电影的主演:" + movies[i].getActor());
                System.out.println("电影的其他信息:" + movies[i].getOther());

            }

            System.out.println("------------------------------");
        }
    }

}
